package concept.misc;

import java.util.HashSet;
import java.util.Iterator;
import java.util.Set;

public class IteratorLab
{
	public static void main(String[] args)
	{
		Set<String> set = new HashSet<String>();
		set.add("one");
		set.add("two");
		set.add("three");
		set.add("four");
		Iterator<String> i = set.iterator();
		Iterator<String> it = i;
		while(it.hasNext())
		{
			System.out.println(it.next());
		}
		i = set.iterator();
		//it = set.iterator();
		while(it.hasNext())
		{
			System.out.println(it.next());
		}
	}
}
